
import * as actionTypes from "./action-types";
import { setCookie } from '../../lib/session';
import {signOut} from '../../lib/auth'
import * as API from '../../api/api';

export const login = (token)=> {
    setCookie('token',token);
    return { type: actionTypes.LOGIN,token};
}
export const logout =  ()=> {
    signOut()
    return { type: actionTypes.LOGOUT };
}
export const updateInfo = (payload={})=>{
    return { type: actionTypes.UPDATE_INFO,payload };
}
export const setAvatar =  (avatar)=>  {
    return { type: actionTypes.SET_AVATAR,avatar };
}
export const setUserName =  (username)=>  {
    return { type: actionTypes.SET_USERNAME,username };
}

